package ru.study.thinkin.chapter11;

import java.util.*;

public class SipmleIteration {
	
	public static void main(String[] args) {
		List<Pet> pets = Pets.arrayList(5);
		Iterator<Pet> it = pets.iterator();
		while (it.hasNext()) {
			Pet p = it.next();
			System.out.println(p.id+" "+p);
			if (p.id>70) {
				it.remove();
			} 
		}
		
		System.out.println(pets);

	}

}
